import React, { Component } from 'react';
import { Modal, Button, Form, Input, Spin } from 'antd';
import { UserOutlined, LockOutlined } from '@ant-design/icons';
import { withRouter } from 'react-router-dom';
import {connect} from 'react-redux'

// 
import AdminLoginForm from './adminLoginForm';

import './index.css'



// 用户登录弹窗代码
class AdminLogin extends Component {

  handleCancel = () => {
    this.props.history.push("/")
  }

  render() {
    // 获得提交的状态
    const {LoginState} = this.props
    return (
      <div>
          <Modal
            maskClosable={false}
            visible={true}
            title='管理员登录'
            onCancel={this.handleCancel}
            footer={[]}
          >
            <AdminLoginForm /> 
            
          </Modal>
      </div>
    );
  }
}

export default connect(
  state => ({
    LoginState: state.LoginReducer.login
  }),
  {
  }
)(withRouter(AdminLogin))
